import Vue from 'vue'
import VueRouter from 'vue-router'
//租房一级路由
import Login from '../zhufang/login.vue'
import Layout from '../zhufang/layout.vue'
//租房二级路由
import Index from '../zhufang/sub/index.vue'
import Findfang from '../zhufang/sub/findfang.vue'
import Zixun from '../zhufang/sub/zixun.vue'
import My from '../zhufang/sub/my.vue'
//租房三级路由
import Zhengzu from '../zhufang/sub1/zhengzhu.vue'
import Hezhu from '../zhufang/sub1/hezhu.vue'
import Map from '../zhufang/sub1/map.vue'
import Getzu from '../zhufang/sub1/getzu.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/layout',
    name: 'Layout',
    component: Layout,
    redirect: '/layout/index',
    children: [
      {
        path: '/layout/index',
        name: 'Index',
        component: Index,
        redirect: '/zhengzu',
        children: [
          {
            path: '/zhengzu',
            name: 'Zhengzu',
            component: Zhengzu
          },
          {
            path: '/hezhu',
            name: 'Hezhu',
            component: Hezhu
          },
          {
            path: '/map',
            name: 'Map',
            component: Map
          },
          {
            path: '/getzu',
            name: 'Getzu',
            component: Getzu
          },
        ]
      },
      {
        path: '/layout/findfang',
        name: 'Findfang',
        component: Findfang
      },
      {
        path: '/layout/zixun',
        name: 'Zixun',
        component: Zixun
      },
      {
        path: '/layout/my',
        name: 'My',
        component: My
      },

    ]
  },

]
const router = new VueRouter({
  routes
})

export default router
